﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using XiaFControl.Controls;

namespace XiaFControl.Demo.ViewModels
{
    public class DialogContentViewModel : ObservableObject, IDialog
    {
        public DialogResult Result { get; set; }
        public Action CloseAction { get; set; }

        public RelayCommand CloseCommand { get; set; }

        public DialogContentViewModel()
        {
            CloseCommand = new RelayCommand(Close);
        }

        private void Close()
        {
            Result = new DialogResult() { MessageBoxResult = System.Windows.MessageBoxResult.Yes };
            CloseAction?.Invoke();
        }
    }
}
